<template>
    <div>
        <div style="display: flex;justify-content: center;align-items: center;height: 100vh;font-size: 15px">
            <div style="display: flex;flex-direction: column;align-items: center;margin-bottom: 10px">
                <div><img src="../../assets/img/wxpay_icon.png" alt="" style="width: 32px;height: 32px;margin-bottom: 10px"></div>
                <div>请使用微信内置浏览器登录</div>
            </div>
        </div>
        <!--<div class="index-logo">-->
            <!--<div class="logo">-->
                <!--<img src="../../assets/img/index_bg.png">-->
                <!--<a href="https://beian.miit.gov.cn/" style="color: #c6c6c7; line-height: 28px;">蜀ICP备2020028185号-3</a>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="forms">-->
            <!--<div class="item flex_r_b">-->
                <!--<input type="text" name="mobile" value="" placeholder="账号" v-model="account">-->
            <!--</div>-->
            <!--<div class="item flex_r_b">-->
                <!--<input type="password" name="password" value="" placeholder="密码" v-model="password">-->
            <!--</div>-->
            <!--<div class="item01">-->
                <!--<span class="regist" @click="toregist()">去注册</span>-->
            <!--</div>-->
        <!--</div>-->
        <!--<input type="button" class="red_btn" value="登录" @click="login()">-->
    </div>
</template>

<script type="text/javascript">
    export default {
        name: "",
        data(){
            return{
                account:"",
                password:""
            }
        },
        mounted(){

        },
        methods:{
            toregist(){
                this.$router.push("/log/register")
            },
            login(){
                var that=this;
                that.$axios.post(that.Url+'api/user.index/login',{
                    account:that.account,
                    password:that.password,
                }).then(function(res){
                    console.log(res)
                    if(res.data.code == 1){
                        localStorage.setItem('token', res.data.data.userinfo.token);
                        // that.$router.push('/');
                        that.$router.go(-1);
                        var appdata={"token":res.data.data.userinfo.token,"id":res.data.data.userinfo.id};
                        var u = navigator.userAgent;
                        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
                        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
                        if(isiOS){
                            window.webkit.messageHandlers.loadUserInfo.postMessage(JSON.stringify(appdata));
                        }else if(isAndroid){
//                            alert("安卓")
                            window.hldq.loadUserInfo(JSON.stringify(appdata));
                        }
                    }else {
                        that.$toast(res.data.msg)
                    }
                }).catch(function (error) {
                    that.$toast(error.data.msg)
                })
            }
        }
    }
</script>

<style scoped>
    .index-logo {
        display: -webkit-box;
        margin-top: 10px;
    }
    .index-logo .logo {
        -webkit-box-flex: 1;
        margin-right: 11%;
        margin-left: 20px;
        vertical-align: middle;
        min-height: 30px;
        line-height: 24px;
    }
    .index-logo .logo img {
        display: inline-block;
        width: 100%;
    }
    .forms{
        display: block;
        background: #fff;
        margin: 7px 10px 0;
        padding: 15px;
        border-radius: 4px;
    }
    .forms .item{
        height: 36px;
        border-radius: 4px;
        font-size: 13px;
        border: 1px solid #e5e5e5;
        padding: 0 4%;
        background: #f9f9fb;
        width: 92%;
        display: block;
        margin-bottom: 15px;
    }
    .forms .item:first-child{
        margin-top: 0
    }
    .forms label{
        width: 24px;
    }
    .forms .item input{
        line-height: 36px;
    }
    .hide{
        display: none;
    }
    .forms .iconfont{
        color: #eee;
        font-size: 24px;
    }
    .forms .icon-zhanghao{
        width: 24px;
        height: 24px;
        border: 1px solid #eeeeee;
        border-radius: 50%;
        font-size: 20px;
        text-align: center;
    }
    .forms input{
        width: calc(100% - 30px);
        font-size: 15px;
        color: #333
    }
    .forms .item01{
        padding: 0 15px 0 5px;
        box-sizing: border-box;
        font-size: 14px;
        color: #999999
    }
    .forms .item01 .regist{
        font-size: 12px;
        color: #ff5641;
    }
    .forms .item02{
        margin-top: 12px
    }
    .forms .item02 .item{
        width: calc(100% - 84px)
    }
    .forms .item02 .getcode{
        width: 80px;
        color: #ff5641;
        font-size: 12px;
        text-align: center;
        text-decoration: underline;
    }
    .red_btn {
        border-radius: 4px;
    }
    .red_btn {
        background: #fc5d4d;
        color: #fff;
        font-size: 14px;
        text-align: center;
        height: 40px;
        line-height: 40px;
        width: 90%;
        margin: 20px 5% 100px;
        box-shadow: 0 5px 10px #f6a59f;
    }
</style>
